package icu.wdtt.service;

import icu.wdtt.exception.UserException;
import icu.wdtt.model.User;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

@Transactional
public interface UserService {

    public Boolean setUser(String username , String password,String email , String roleName) throws Exception;

    public User get(int uid);

    public List<User> getAll();

    public Boolean del(int uid);

    public Boolean update(User user);

    public Boolean add(User user);

    public User login(String username,String password) throws UserException;

    public List<User> getPage(int pageNum , int pageSize);

    public Boolean register(String username, String password,String email);

    public Boolean isUserName(String username);

    public Boolean isEmail(String code , String emailId);

    public Boolean retPassword(String username , String email , String emailCode, String password, String emailId) throws UserException;

    public Boolean updatePassword(int uid,String oldPassword ,String newPassword) ;

    public List<User> getUserAndRoleAll();

    public User getUserAndRoleByUid(int uid);

    public List<User> getUserAndFilesAll();

    public User getUserAndFilesByUid(int uid);
}
